package com.myspring.web.view.excel;

import com.myspring.web.form.Student;
import org.junit.Test;

import java.lang.reflect.Field;

/**
 * @author : zenghua
 * @version : v0.1 ClassTest.java
 * @since : 2018/4/27 11:30
 */
public class ClassTest {

	@Test
	public void test() throws Exception {
		Student student = new Student();
		student.setId(1);

		Class<Student> clazz = (Class<Student>) student.getClass();
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			field.setAccessible(true);
			Object obj = field.get(student);
			System.out.println(obj);
		}
	}
}
